<template>
	<view id="app">
		<view style="border: 3px solid blue;">
			<button style="margin: 5px" @click="handleSwitchTab('/pages/index/index')" >Index页面</button>
			<button style="margin: 5px" @click="handleSwitchTab('/pages/test/test')" >Test页面</button>
			<button style="margin: 5px" @click="handleNavigateTo('/pagePackageA/user/user')" >User页面</button>
		</view>
		
		<view style="border: 3px solid orange; marginTop: 1px;">
			<!-- 路由出口 -->
			<router-view></router-view>
		</view>
	</view>
</template>

<script>
	export default {
		onLaunch: function() {
			console.log('=========App Launch=========')
		},
		onShow: function() {
			console.log('=========App Show=========')
		},
		onHide: function() {
			console.log('=========App Hide=========')
		},
		methods: {
			handleNavigateTo(url) {
				console.log("url=", url)
				uni.navigateTo({url: url})
			},
			
			handleSwitchTab(url) {
				console.log("url=", url)
				uni.switchTab({url: url})
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
